//
//  ImageTextButton.m
//  CedarFinancialPlanner
//
//  Created by lshenrong on 2018/8/10.
//  Copyright © 2018年 cedarhd. All rights reserved.
//

#import "ImageTextButton.h"

@implementation ImageTextButton

+ (instancetype)imageTextButtonWith:(NSString *)title image:(NSString *)imageName  {
    ImageTextButton *btn = [super buttonWithType:UIButtonTypeCustom];
    if (btn) {
        [btn setImage:[UIImage imageNamed:imageName] forState:UIControlStateNormal];
        [btn setTitle:title forState:UIControlStateNormal];
        [btn initializeUI];
    }
    return btn;
}

- (void)initializeUI{
    self.titleLabel.font = PingFangZhongChangGuiForFont(12);
    [self setTitleColor:kGrayColor forState:UIControlStateNormal];
    self.titleEdgeInsets = UIEdgeInsetsMake(0, 20, 0, 0);
    self.imageView.contentMode = UIViewContentModeScaleAspectFit;
}

- (void)layoutSubviews{
    [super layoutSubviews];
}
@end
